function addGadget()
{
var specURL = document.getElementById( "getURL" );
//gadgets.rpc.call("", "addGadgetsBulk", null, specURL.value);
}

function removeGadget( id )
{
	alert("Removing " + id);
	table = document.getElementById("tableID").getElementsByTagName("TBODY")[0];
	row = document.getElementById(id);
	table.removeChild(row);
	//gadgets.rpc.call("deletePlayer", id);
}

function showGadget( id, checked )
{
	if (checked)
	{
		alert(id + " is shown");
	}
	else alert(id + " is hidden");
	//gadgets.rpc.call("", "showHidePlayer", null, null, id , checked);
}

function getList(gadgets)
{
	var table = document.getElementById("tableID").getElementsByTagName("TBODY")[0];
	for (var i in gadgets)
	{
	var row = document.createElement("TR");
	row.setAttribute( "id", i);
    var td1 = document.createElement("TD");
	td1.appendChild(document.createTextNode(gadgets[i].title));
	var td2 = document.createElement("TD");
	var element = document.createElement( "input" );
	element.setAttribute( "type", 'button' ); 
	element.setAttribute( "value", 'Remove' );
	element.setAttribute( "name", i );
	element.setAttribute( "onclick", "removeGadget(this.name)");
	td2.appendChild( element );
	var td3 = document.createElement("TD");
	element = document.createElement("input");
	element.setAttribute( "type", 'checkbox' );
	element.setAttribute( "value", 'Show' );
	element.setAttribute( "name", i );
	element.setAttribute( "onclick", "showGadget(this.name, this.checked)");
	td3.appendChild( element );
	row.appendChild(td1);
	row.appendChild(td2);
	row.appendChild(td3);
	table.appendChild(row);
	}
}